﻿<!--
(c) Copyright Cory Plotts.
This source is subject to the Microsoft Public License (Ms-PL).
Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
All other rights reserved.
-->
<Window
	x:Class="Snoop.EditUserFilters"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:converters="clr-namespace:Snoop.Converters"
	Title="Edit Filter Sets"
	Width="500"
	Height="300"
>
	<Window.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="Icons.xaml"/>
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</Window.Resources>
	
	<Grid Margin="4">
		<Grid.RowDefinitions>
			<RowDefinition Height="*"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
		</Grid.RowDefinitions>
		
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="75"/>
			<ColumnDefinition Width="*"/>
			<ColumnDefinition Width="Auto"/>
		</Grid.ColumnDefinitions>

		<TextBlock
			Grid.Row="1"
			Grid.Column="0"
			Style="{x:Null}"
			VerticalAlignment="Center"
			Text="Name:"
		/>
		<TextBox
			Grid.Row="1"
			Grid.Column="1"
			VerticalAlignment="Center"
			Text="{Binding Path=SelectedItem.DisplayName, ElementName=filterSetList}"
		/>
		<TextBlock
			Grid.Row="2"
			Grid.Column="0"
			Style="{x:Null}"
			VerticalAlignment="Center"
			Margin="0,4,0,0"
			Text="Properties:"
		/>
		<TextBox
			Grid.Row="2"
			Grid.Column="1"
			Style="{x:Null}"
			VerticalAlignment="Center"
			Margin="0,4,0,0"
			Text="{Binding Path=SelectedItem.Properties, ElementName=filterSetList, Converter={x:Static converters:CsvStringToArrayConverter.Default}}"
		/>

		<ListBox
			x:Name="filterSetList"
			Grid.Row="0"
			Grid.ColumnSpan="2"
			ItemsSource="{Binding ItemsSource}"
			SelectionChanged="SelectionChangedHandler"
			Margin="0,0,0,10"
		>
			<ListBox.ItemTemplate>
				<DataTemplate>
					<TextBlock Style="{x:Null}" Text="{Binding DisplayName}"/>
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>
		
		<StackPanel
			Grid.Row="3"
			Grid.Column="1"
			Grid.ColumnSpan="2"
			HorizontalAlignment="Right"
			Margin="0,10,5,5"
			Orientation="Horizontal"
		>
			<Button
				Width="75"
				IsDefault="True"
				Click="OkHandler"
			>
				<TextBlock Style="{x:Null}" Text="OK"/>
			</Button>
			<Button
				Width="75"
				Margin="5,0,0,0"
				IsCancel="True"
				Click="CancelHandler"
			>
				<TextBlock Style="{x:Null}" Text="Cancel"/>
			</Button>
		</StackPanel>

		<StackPanel
			Grid.Row="0"
			Grid.Column="2"
			Margin="5,0,5,0"
			VerticalAlignment="Center"
		>
			<Button
				x:Name="MoveUp"
				Width="20"
				Height="20"
				Click="UpHandler"
			>
				<Image Source="{StaticResource scopeUpDrawingImage}" Margin="3"/>
			</Button>
			<Button
				x:Name="MoveDown"
				Width="20"
				Height="20"
				Margin="0,5,0,0"
				Click="DownHandler"
			>
				<Image Source="{StaticResource scopeUpDrawingImage}" Margin="3" RenderTransformOrigin="0.5,0.5">
					<Image.RenderTransform>
						<RotateTransform Angle="180"/>
					</Image.RenderTransform>
				</Image>
			</Button>
			<Button
				Width="50"
				Margin="0,10,0,0"
				Click="AddHandler"
			>
				<TextBlock Style="{x:Null}" Text="Add"/>
			</Button>
			<Button
				x:Name="DeleteItem"
				Width="50"
				Margin="0,5,0,0"
				Click="DeleteHandler"
			>
				<TextBlock Style="{x:Null}" Text="Delete"/>
			</Button>
		</StackPanel>
	</Grid>
</Window>
